<%--
  Created by IntelliJ IDEA.
  demo6.User: 周安妮
  Date: 2025/11/11
  Time: 21:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>application作用域测试</title>
</head>
<body>
<%
  // 向application作用域存数据（全局共享）
  Integer visitCount = (Integer) application.getAttribute("visitCount");
  if (visitCount == null) {
    visitCount = 1;
  } else {
    visitCount++;
  }
  application.setAttribute("visitCount", visitCount);
%>
<h3>session作用域的值（浏览器没关就还有）：${sessionScope.sessionMsg}</h3>
<h3>application全局访问量：${applicationScope.visitCount}</h3>
</body>
</html>
